package com.mhz.mvc.cfg;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 控制器信息
 * @author mhz
 *
 */
public class ActionCfg {
	/**
	 * 访问名
	 */
	private String name;
	/**
	 * 控制器路径
	 */
	private String classPath;
	/**
	 * 拦截器
	 */
	private List<InterceptorCfg> interceptorCfgs = new ArrayList<InterceptorCfg>();
	/**
	 * 返回值
	 */
	private Map<String, ResultCfg> resultCfgs = new HashMap<String, ResultCfg>();
	
	public ActionCfg(){
		
	}
	
	public void addInterceptorCfg(InterceptorCfg interceptorCfg) {
		interceptorCfgs.add(interceptorCfg);
	}

	public List<InterceptorCfg> getInterceptorCfgs() {
		return interceptorCfgs;
	}

	public void addResultCfg(ResultCfg resultCfg) {
		resultCfgs.put(resultCfg.getName(), resultCfg);
	}

	public ResultCfg getResultCfg(String name) {
		return resultCfgs.get(name);
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getClassPath() {
		return classPath;
	}
	public void setClassPath(String classPath) {
		this.classPath = classPath;
	}
}
